cmake_minimum_required(VERSION 3.4.1)
file(GLOB allCpp *.cpp)
add_library( # Sets the name of the library.
        nx-player

        # Sets the library as a shared library.
        SHARED

        # Provides a relative path to your source file(s).
        ${allCpp})

find_library( # Sets the name of the path variable.
        log-lib

        # Specifies the name of the NDK library that
        # you want CMake to locate.
        log)

include_directories(${CMAKE_SOURCE_DIR}/ffmpeg/include)

# 导入FFmpeg库文件
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -L${CMAKE_SOURCE_DIR}/ffmpeg/libs/${CMAKE_ANDROID_ARCH_ABI}")

# RTMP的库文件
set(CMAKE_CXX_FLAGS  "${CMAKE_CXX_FLAGS} -L${CMAKE_SOURCE_DIR}/rtmp/libs/${CMAKE_ANDROID_ARCH_ABI}")


target_link_libraries( # Specifies the target library.
        nx-player

        -Wl,--start-group # 忽略顺序引发的问题
        avcodec avfilter avformat avutil swresample swscale
        -Wl,--end-group
        # Links the target library to the log library
        # included in the NDK.
        ${log-lib}
        z
        )